package com.flowable.flow_02.定时器.开始事件;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.repository.Deployment;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * Flowable 定时器开始事件测试
 */
@Slf4j
@SpringBootTest
public class FlowTimerStartEventTest02 {

    @Resource
    private RepositoryService repositoryService;

    @Test
    void deployFlowTest() throws InterruptedException {
        Deployment deploy = repositoryService.createDeployment()
                .addClasspathResource("process/02-高级篇/event-timer-02.bpmn20.xml")
                .name("定时任务-开始事件-02")
                .deploy();
        log.info("部署流程定义成功，流程定义ID：{}", deploy.getId());
        TimeUnit.SECONDS.sleep(Integer.MAX_VALUE);
    }
}
